<template>
  <div class="page-container">
    <!-- 面包屑部分 -->
    <div class="breadcrumb">
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item>会员中心</el-breadcrumb-item>
        <el-breadcrumb-item>会员等级管理</el-breadcrumb-item>
        <el-breadcrumb-item>查看子平台等级</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="tab-container">
      <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
      <el-tab-pane label="基础设置" name="first">
        <div class="toolbar" >
          <el-form :inline="true" :model="baseFilters" :size="size" ref="baseFilters" >
            <el-row class="search-input">
              <el-form-item label="所属平台：">
                <el-select v-model="baseFilters.deptId"  placeholder="全部" class="w178">
                  <!-- <el-option value="">全部</el-option> -->
                  <el-option
                    v-for="item in deptOption"
                    :key="item.id"
                    :label="item.deptName"
                    :value="item.id"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-row>
            <el-row class="search-button-noborder">
              <el-form-item>
                <kt-button icon="el-icon-search" :label="'搜索'" type="primary" @click="findPageGrowBaseClick(null)" :size="size"/>
              </el-form-item>
              <el-form-item>
                <kt-button :label="$t('action.reset')" type="primary" @click="resetForm('baseFilters')" :size="size" :plain = "true" />
              </el-form-item>
            </el-row>
          </el-form>
        </div>
        <!--表格+分页器-->
        <div style="width:100%">
          <!--表格-->
          <el-table :data="tableDataGrowth" :header-cell-style="{ 'color': '#FFF','background-color': '#409EFF','text-align': 'center'}"
            :highlight-current-row="true"
            :max-height="15000"
            :size="'mini'"
            v-loading="loadingBase"
          >
            <el-table-column align="center" label="每日获取成长值上限"  element-loading-text>
              <template slot-scope="scope">
                <span>{{ scope.row.growthDayMax }}</span>
              </template>
            </el-table-column>
            <el-table-column  align="center" label="所属平台">
              <template slot-scope="scope">
                <span>{{ scope.row.deptName}}</span>
              </template>
            </el-table-column>
          </el-table>
          <!--分页栏v-if="scope.row.status == 1"-->
          <div class="toolbar t_r">
            <el-pagination
              layout="total, prev, pager, next, jumper,sizes"
              @current-change="currentChange1"
              @size-change="sizeChange1"
              :current-page="baseFilters.start"
              :page-size="baseFilters.limit"
              :total="baseTotalSize"
              :page-sizes="[10, 20, 30, 40]"          
            ></el-pagination>
          </div>
        </div>
      </el-tab-pane>
      <el-tab-pane label="成长值规则列表" name="second">
        <div class="toolbar" >
          <el-form :inline="true" :model="growFilters" :size="size" ref="growFilters" :rules="growFiltersRules">
            <el-row class="search-input">
            <el-form-item label="规则编号：" prop="growthNum" class="mb30 ">
              <el-input v-model="growFilters.growthNum" clearable placeholder="输入规则编号" maxlength="80"></el-input>
            </el-form-item>
            <el-form-item label="规则名称：" prop="ruleName" class="mb30 ">
             <el-input v-model="growFilters.ruleName" clearable placeholder="输入规则名称" maxlength="80"></el-input>
            </el-form-item>
            <el-form-item label="所属组织：" class="mb30 ">
                <el-select v-model="growFilters.deptId"  placeholder="全部" clearable>
                  <!-- <el-option value="">全部</el-option> -->
                  <el-option
                    v-for="item in deptOption"
                    :key="item.id"
                    :label="item.deptName"
                    :value="item.id"
                  ></el-option>
                </el-select>
              </el-form-item>
              <el-row class="times">
                <el-form-item label="创建时间：" prop="startTime">
                  <el-date-picker
                    v-model="growFilters.startTime"
                    type="datetime"
                    placeholder="开始时间"
                    format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    clearable
                    @change="changeStartDate"
                   :picker-options="startDateDisabled"
                  ></el-date-picker>
                </el-form-item>
                <span class="times-to">-</span>
                <el-form-item prop="endTime">
                  <el-date-picker
                    v-model="growFilters.endTime"
                    type="datetime"
                    placeholder="结束时间"
                    format="yyyy-MM-dd HH:mm:ss"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    clearable
                    @change="changeEndDate"
                   :picker-options="endDateDisabled"
                  ></el-date-picker>
                </el-form-item>
                <!-- <el-form-item label="创建时间：">
                  <el-date-picker v-model="growFilters.startTime" type="datetime" placeholder="开始时间" clearable></el-date-picker>
                  <span class="times-to">-</span>
                  <el-date-picker v-model="growFilters.endTime" type="datetime" placeholder="结束时间" clearable></el-date-picker>
                </el-form-item> -->
              </el-row>
              </el-row>
            <el-row class="search-button-noborder">
              <el-form-item>
                <kt-button icon="el-icon-search" :label="'搜索'" type="primary" @click="findPageGrowClick(null)" :size="size"/>
              </el-form-item>
              <el-form-item>
                <kt-button :label="$t('action.reset')" type="primary" @click="resetForm('growFilters')" :size="size" :plain = "true"/>
              </el-form-item>
            </el-row>
          </el-form>
        </div>
        <!--表格+分页器-->
        <div style="width:100%">
          <!--表格-->
          <el-table :data="tableData" :header-cell-style="{ 'color': '#FFF','background-color': '#409EFF','text-align': 'center'}"
            :highlight-current-row="true"
            :max-height="15000"
            :size="'mini'"
            v-loading="loadingGrowth"
          >
            <el-table-column align="center" label="编号" element-loading-text>
              <template slot-scope="scope">
                <span>{{ scope.row.growthNum }}</span>
              </template>
            </el-table-column>

            <el-table-column  align="center" label="规则名称">
              <template slot-scope="scope">
                <span>{{ scope.row.ruleName}}</span>
              </template>
            </el-table-column>
            <el-table-column  align="center" label="获取方式">
              <template slot-scope="scope">
                <span v-if="scope.row.obtainMode == 1">下单赠送</span>
                <span v-if="scope.row.obtainMode == 2">注册赠送</span>
                <span v-if="scope.row.obtainMode == 3">评价赠送</span>
                <span v-if="scope.row.obtainMode == 4">充值赠送</span>
                <span v-if="scope.row.obtainMode == 5">分享赠送</span>
                <span v-if="scope.row.obtainMode == 6">点赞赠送</span>
                <span v-if="scope.row.obtainMode == 7">晒单赠送</span>
                <span v-if="scope.row.obtainMode == 8">收藏赠送</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="成长值">
              <template slot-scope="scope">
                <span>{{ scope.row.giveGrowthVal}}</span>
              </template>
            </el-table-column>
            <el-table-column  align="center" label="所属平台">
              <template slot-scope="scope">
                <span>{{ scope.row.deptName}}</span>
              </template>
            </el-table-column>
            <el-table-column  align="center" label="创建时间">
              <template slot-scope="scope">
                <span>{{ scope.row.createTime}}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="状态"  width="300" fixed="right">
              <template slot-scope="scope">
                <span v-if="scope.row.status == 1" >启用</span>
                <span v-if="scope.row.status == 0" >禁用</span>
              </template>
            </el-table-column>
          </el-table>
          <!--分页栏v-if="scope.row.status == 1"-->
          <div class="toolbar t_r">
            <el-pagination
              layout="total, prev, pager, next, jumper,sizes"
              @current-change="currentChange"
              :current-page="growFilters.start"
              :page-size="growFilters.limit"
              :total="growthTotalSize"
              :page-sizes="[10, 20, 30, 40]"
              @size-change="sizeChange"
            ></el-pagination>
          </div>
        </div>
      </el-tab-pane>
      <el-tab-pane label="等级权益设置" name="third">
        <div class="toolbar" >
          <el-form :inline="true" :model="filters" :size="size" ref="filters" :rules="filtersRules">
            <el-row class="search-input">
              <el-row class="times">
              <el-form-item label="创建时间：" prop="startTime">
                <el-date-picker
                  v-model="filters.startTime"
                  type="datetime"
                  placeholder="开始时间"
                  format="yyyy-MM-dd HH:mm:ss"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  clearable
                   @change="changeStartDatePower"
                   :picker-options="startDateDisabledPower"
                ></el-date-picker>
              </el-form-item>
              <span class="times-to">-</span>
              <el-form-item prop="endTime">
                <el-date-picker
                  v-model="filters.endTime"
                  type="datetime"
                  placeholder="结束时间"
                  format="yyyy-MM-dd HH:mm:ss"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  clearable
                  @change="changeEndDatePower"
                :picker-options="endDateDisabledPower"
                ></el-date-picker>
              </el-form-item>
                <!-- <el-form-item label="创建时间：">
                <el-date-picker v-model="filters.startTime" type="datetime" placeholder="开始时间" clearable></el-date-picker>
                <span class="times-to">-</span>
                <el-date-picker v-model="filters.endTime" type="datetime" placeholder="结束时间" clearable></el-date-picker>
              </el-form-item> -->
             </el-row>
              <el-form-item label="等级名称：" prop="levelName" class="mb30 mr30">
               <el-input v-model="filters.levelName" class="w178" placeholder="输入等级名称" maxlength="80" clearable></el-input>
              </el-form-item>
              <el-form-item label="所属组织：" class="mr30">
                <el-select v-model="filters.childId"  placeholder="全部" class="w178 ">
                  <!-- <el-option value="">全部</el-option> -->
                  <el-option
                    v-for="item in deptOption"
                    :key="item.id"
                    :label="item.deptName"
                    :value="item.id"
                  ></el-option>
                </el-select>
              </el-form-item>
            <!-- <el-row class="times">
                <el-form-item label="创建时间：">
                <el-date-picker v-model="filters.startTime" type="datetime" placeholder="开始时间" clearable></el-date-picker>
                <span class="times-to">-</span>
                <el-date-picker v-model="filters.endTime" type="datetime" placeholder="结束时间" clearable></el-date-picker>
              </el-form-item>
            </el-row> -->
            </el-row>
            <el-row class="search-button-noborder">
              <el-form-item>
                <kt-button icon="el-icon-search" :label="'搜索'" type="primary" @click="findPageClick(null)" :size="size"/>
              </el-form-item>
              <el-form-item>
                <kt-button :label="$t('action.reset')" type="primary" @click="resetForm('filters')" :size="size" :plain = "true"/>
              </el-form-item>
            </el-row>
          </el-form>
        </div>
        <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
        <div class="toolbar" >
          <table-column-filter-dialog
            ref="tableColumnFilterDialog"
            :columns="columns"
            @handleFilterColumns="handleFilterColumns"
          ></table-column-filter-dialog>
        </div>
        <!--表格内容栏-->
        <!-- <cy-table  :columns="filterColumns" @findPage="findPage" @selectionChange="selectionChange"
          :showBatchDelete="false" :showLookConfiguration="true" :showPushOperation="false" 
          :showSelection="false"
          :size="size"
          :operationWidth="200"
          :showDeleteOperation="false"
          :showEditOperation="false"
          @handleLookPower="handleConfiguration"
          ref="CyTable">
        </cy-table> -->
        <el-table
            :data="tableList"
            :header-cell-style="{ 'color': '#FFF','background-color': '#409EFF','text-align': 'center'}"
            :highlight-current-row="true"
            :max-height="15000"
            :size="'mini'"
            class="specialTable"
            :border="false"
            v-loading="loading"
          >
            <el-table-column align="center" label="编号"  element-loading-text>
              <template slot-scope="scope">
                <span>{{ scope.row.id}}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="等级名称"  element-loading-text>
              <template slot-scope="scope">
                <span>{{ scope.row.levelName || '-'}}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="所属平台"  element-loading-text>
              <template slot-scope="scope">
                <span>{{ scope.row.deptName || '-'}}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="权益数"  element-loading-text>
              <template slot-scope="scope">
                <span>{{ scope.row.roleTotal || '-'}}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="创建时间"  element-loading-text>
              <template slot-scope="scope">
                <span>{{ scope.row.createTime || '-'}}</span>
              </template>
            </el-table-column>
            
            <el-table-column class-name="status-col" align="left" fixed="right" label="操作" width="450" >
              <template slot-scope="scope">
                <kt-button
                  @click="handleConfiguration(scope.row)" type="text" size="mini" style label="查看权益" perms="mem:label:edit">
                </kt-button>
                
              </template>
            </el-table-column>
          </el-table>
           <!--分页栏-->
          <div class="toolbar" style="padding:10px;">
            <el-pagination
              layout="total, sizes, prev, pager, next, jumper"
              @current-change="powerCurrentChange"
              :current-page="filters.start"
              :page-size="filters.limit"
              :total="totalSize"
              style="float:right;"
              :page-sizes="[10, 20, 30, 40]"
              @size-change="powerSizeChange"
            ></el-pagination>
          </div>

        <!--配置权益-->
          <el-dialog title="配置权益" width="70%" :visible.sync="rulePowerVisible" :close-on-click-modal="false" @closed="handleClose">
            <el-form ref="rulePowerForm" label-width="80px" :model="rulePowerForm">
              <el-row>
              <el-col :span="6"> <el-form-item label="等级名称:"> {{rulePowerForm.levelName}}</el-form-item></el-col>
              <el-col :span="6"> <el-form-item label="所属平台:"> {{rulePowerForm.deptName}}</el-form-item></el-col>
              </el-row>
              <el-row>
                <el-form-item label="等级权益:">
                  <template>
                    <el-table :data="tableDataRule" style="width: 100%">
                      <el-table-column prop="legalRuleName" :label="vipLabel" width="300" size="mini"></el-table-column>
                    </el-table>
                  </template>
                </el-form-item>
              </el-row>
                  <div style="text-align:center">
                    <el-button :size="size" @click.native="rulePowerVisible = false">{{ $t("action.cancel") }}</el-button>
                  </div>
            </el-form>
          </el-dialog>
      </el-tab-pane>
      </el-tabs>
    </div>
  </div>  
</template>
<script>
  import {exportExcel} from "@/utils/excel";
  import CyTable from "@/views/Core/JicTable";
  import KtButton from "@/views/Core/KtButton";
  import {format} from "@/utils/datetime";
  import TableColumnFilterDialog from "@/views/Core/TableColumnFilterDialog";
  import {validatePhone,validateContacts,isEmail,isNumber} from '@/utils/validate'
  import XLSX from "xlsx";
  export default {
    components: {
      CyTable,
      KtButton,
      TableColumnFilterDialog,
    },
    data() { 
      
      return {
        startDateDisabledPower: {},//开始时间限制
        endDateDisabledPower: {},//结束时间限制
        startDateDisabled: {},//开始时间限制
        endDateDisabled: {},//结束时间限制
        totalSize:0,
        tableList:[],
        loadingBase:false,
        loadingGrowth:false,
        loading:false,
        growFiltersRules:{
          // startTime: [{ validator: checkGrowthStartTime, trigger: "change" }],
          // endTime: [{ validator: checkGrowthEndTime, trigger: "change" }],
        },
        filtersRules: {
          // startTime: [{ validator: checkStartTime, trigger: "change" }],
          // endTime: [{ validator: checkEndTime, trigger: "change" }],
        },
        vipLabel:'',
        tableDataRule:[],
        baseTotalSize: 0,
        growthTotalSize: 0,
        tableDataGrowth:[],
        tableData: [],
        data:[],
        deptOption:[],
        activeName:"first",
        childId:'',
        userId:localStorage.getItem("userId"),//当前登录用户id
        deptType:localStorage.getItem("deptType"),//当前登录用户所属组织类型
        childOptions:[],
        size: "mini",
        baseFilters:{
          deptId:null,
          deleteFlag:0,
          deptType:1,
          start: 1,
          limit: 10 
        },
        growFilters: {
          endTime:null,
          startTime:null,
          growthNum:'',
          ruleName:'',
          deptId:null,
          start: 1,
          limit: 10  
        },
        filters: {
          startTime:null,
          endTime:null,
          levelName:'',
          childId:'',
          isMom:1,
          start: 1,
          limit: 10,
          storeMember:2,          
        },
        rulePowerForm: {
          id:'',
          deptId:'',
          deptName:"",
          vipName:'',
          ruleIds:[],
       },
        columns:[
          {prop: "id", label: "编号", minWidth: 90},
          {prop: "levelName", label: "等级名称", minWidth: 120},
          {prop: "deptName", label: "所属平台", minWidth: 120},
          {prop: "roleTotal", label: "权益数", minWidth: 120},
          {prop: "createTime", label: "创建时间", minWidth: 120}, 
          ],
        
        filterColumns: [],
        pageRequest: {pageNum: 1, pageSize: 10},
        pageResult: [{}],
        rulePowerVisible:false,
        printPage:false,
        operation: false, // true:新增, false:编辑
        editDialogVisible: false, // 新增编辑界面是否显示
        editLoading: false,
        reviewFormRules: {
          childId: [{required: true, message: "请选择所属子平台", trigger: "change"}],
        },
        reviewForm: {
          reviewReason: "",
          status: "",
          childId:null,
        },
        checked: [],
        reviewFormVisible:false,
      };
    },
    methods: {
      changeStartDate: function() {
      var this_ = this;
      this_.endDateDisabled = {
        disabledDate: time => {
          if (this_.growFilters.startTime) {
            return time.getTime() <= new Date(this_.growFilters.startTime).getTime();
          }
        }
      };
    },
    changeEndDate: function() {
      var this_ = this;
      this_.startDateDisabled = {
        disabledDate: time => {
          if (this_.growFilters.endTime) {
            return time.getTime() >= new Date(this_.growFilters.endTime).getTime();
          }
        }
      };
    },
    changeStartDatePower: function() {
      var this_ = this;
      this_.endDateDisabledPower = {
        disabledDate: time => {
          if (this_.filters.startTime) {
            return time.getTime() <= new Date(this_.filters.startTime).getTime();
          }
        }
      };
    },
    changeEndDatePower: function() {
      var this_ = this;
      this_.startDateDisabledPower = {
        disabledDate: time => {
          if (this_.filters.endTime) {
            return time.getTime() >= new Date(this_.filters.endTime).getTime();
          }
        }
      };
    },
      // 换页刷新
      powerCurrentChange(pageNum) {
        this.pageRequest.pageNum = pageNum;
        this.findPage();
      },
      powerSizeChange(pageSize) {
        this.pageRequest.pageNum = 1;
        this.pageRequest.pageSize = pageSize;
        this.findPage();
      },
      //配置权限弹框
      handleConfiguration(data){
        this.$router.push({path:"/PowerLookVipTemplate" , query:{id:data.id}});
        // let this_=this;
        // let query={};
        // query.deptId=data.row.deptId
        // query.gradeId=data.row.id
        // query.deleteFlag=0;
        // this_.utils.request.queryMegradeRule(query,function(res){
        //    if (res.code == "0000") {
        //      this_.tableDataRule=res.data;
        //      this_.vipLabel="已选权益"+'('+res.data.length+')';
        //     //    res.data.forEach(items=>{
        //     //     this_.rulePowerForm.ruleIds.push(items.legalRuleId);
        //     //  })
        //     }
        // })
        // this_.rulePowerForm.levelName=data.row.levelName;
        // this_.rulePowerForm.deptName=data.row.deptName;
        // this_.rulePowerForm.deptId=data.row.deptId;
        // this_.rulePowerForm.id=data.row.id;
        // this_.rulePowerVisible=true;
      },
      handleClick(tab, event) {
      },
      returnRuleList: function() {
        this.rulePowerVisible = false;
        this.ruleConsumeVisible = false;
     },
      //获取当前平台下的所有权益
      queryMemberRuleByDeptid(){
        let this_=this
        this_.data=[];
        let query={};
        query.deleteFlag=0;
        query.deptId=this_.childId;
        this_.utils.request.queryMemberRuleByDeptid(query,function(res){
           if(res.code == '0000'){
             res.data.forEach(items=>{
               this_.data.push({
                 key:items.id,
                 label:items.legalRuleName,
               })
             })
           }
        })
      },
      //点击搜索，页码重置
      findPageGrowClick(){
        this.growFilters.start = 1;
        this.queryPageGrow();
      },
      //成长值列表查询
      queryPageGrow() {
        let _this = this;
        this.loadingGrowth=true;
        this.utils.request.getRulistByChild(this.growFilters, function(res) {
          if (res.code == "0000") {
            _this.tableData = res.data.rows;
            _this.growthTotalSize = res.data.total;
            _this.loadingGrowth=false;
          }
        });
      },
      //点击搜索，页码重置
      findPageGrowBaseClick(){
        this.pageRequest.pageNum = 1;
        this.queryPageGrowBase();
      },
      //成长值基础设置列表查询
      queryPageGrowBase() {
        let _this = this;
        this.loadingBase=true;
        this.utils.request.queryMemberGrowthBaseRule(this.baseFilters, function(res) {
          if (res.code == "0000") {
            _this.tableDataGrowth = res.data.rows;
            _this.baseTotalSize = res.data.total;
            _this.loadingBase=false;
          }
        });
      },
      //点击搜索，页码重置
      findPageClick(){
        this.pageRequest.pageNum = 1;
        this.findPage();
      },
      // 获取分页数据
      findPage: function(data) {
        this.loading=true;
        if(data != null && data.start != null){
        if(data.start != null){
          this.pageRequest.pageNum = data.start;
        }
        if(data.limit != null){
          this.pageRequest.pageSize = data.limit;
        }
       }
        let this_ = this;
        if (this_.filters == undefined || this_.filters == null) {
          this_.filters = {};
        }
        this_.filters.start = this.pageRequest.pageNum;
        this_.filters.limit = this.pageRequest.pageSize;
        this.utils.request.queryMegradeRuleList(this_.filters, function (res) {
          if (res.data == null) {
              res.data = [];
              res.totle = 0;
          }else{
              //this_.childId=res.data.rows[0].deptId;
              this_.queryMemberRuleByDeptid();
              // this_.$refs.CyTable.findPage({content:res.data.rows,total:res.data.total});
              this_.tableList=res.data.rows;
              this_.totalSize=res.data.total;
              this_.loading=false;
          }
        });
      },
      //基础设置分页
      currentChange1(start) {
        this.baseFilters.start = start;
        this.queryPageGrowBase();
      },
      //基础设置分页
      sizeChange1(limit) {
        this.baseFilters.start = 1;
        this.baseFilters.limit = limit;
        this.queryPageGrowBase();
      },
      //成长值规则列表分页
      currentChange(start) {
        this.growFilters.start = start;
        this.queryPageGrow();
      },
      //成长值规则列表分页
      sizeChange(limit) {
        this.growFilters.start = 1;
        this.growFilters.limit = limit;
        this.queryPageGrow();
      },
       //获取子平台列表
      queryDeptOption(){
       let query={}
       let this_=this
       query.deptType=1;
       this_.utils.request.getSecondDeptTree(query,function(res){
         if(res.code == '0000'){
           this_.deptOption=res.data[0].children;
         }
       })
      },

      //获取选择框数据
      selectionChange(val) {
        this.checked = val.selections;
      },
      handleClose(data) {
        this.rulePowerForm = {
          id:'',
          deptName:"",
          ruleIds:[]
        },
        this.tableDataRule=[];
        this.$refs.rulePowerForm.resetFields();
      },
      resetForm(formName) {
        if (this.$refs[formName] != undefined) {
          let this_=this;
          let boo;
          let keys=[];
          
            if(formName == 'filters'){
              //需要校验的key
               keys = ["startTime","endTime","levelName","childId"]
               boo = this_.seachTableUtils.checkFromIsNull(this.filters,keys)
              if(!boo){
                return
              };
              this_.filters={
                startTime:'',
                endTime:'',
                levelName:'',
                childId:'',
                isMom:1,
                start: 1,
                limit: 10   
             }
            this_.findPage();
          }else if(formName == 'growFilters'){
            //需要校验的key
               keys = ["startTime","endTime","growthNum","ruleName","deptId"]
               boo = this_.seachTableUtils.checkFromIsNull(this.growFilters,keys)
              if(!boo){
                return
              }
            this_.growFilters={
              endTime:'',
              startTime:'',
              growthNum:'',
              ruleName:'',
              deptId:null,
              start: 1,
              limit: 10  
            },
            this_.queryPageGrow();
          }else if(formName == 'baseFilters'){
            //需要校验的key
               keys = ["deptId"]
               boo = this_.seachTableUtils.checkFromIsNull(this.baseFilters,keys)
              if(!boo){
                return
              }
            this_.baseFilters={
              deptId:null,
              deleteFlag:0,
              deptType:1,
              start: 1,
              limit: 10 
            },
            this_.queryPageGrowBase();
          }
          this.$refs[formName].resetFields();
        }
      },
      
      // 处理表格列过滤显示
      displayFilterColumnsDialog: function () {
        this.$refs.tableColumnFilterDialog.setDialogVisible(true);
      },
      // 处理表格列过滤显示
      handleFilterColumns: function (data) {
        this.filterColumns = data.filterColumns;
        this.$refs.tableColumnFilterDialog.setDialogVisible(false);
      },
      // 处理表格列过滤显示
      initColumns: function () {
        var temp = [];
        $.each(this.columns, function (key, val) {
          temp.push(val);
        });
        this.filterColumns = temp;
      },  
    },
    mounted() {
      this.findPage();
      this.queryDeptOption();
      this.queryPageGrow();
      this.queryPageGrowBase();
    }
  };
</script>

<style scoped lang='scss'>
/deep/ .el-transfer-panel{
   width: 250px !important;
}

.w200{
  width: 200px;
}

.w178{
  width: 178px;
}
.inputWidth178{
  /deep/ .el-input{
    width: 178px !important;
  }
}
.search-input{
  .times {
    .times-to {
      padding: 0 10px;
      height: 32px;
      line-height: 32px;
      color: #999;
      display: inline-block;
    }
    /deep/ .el-input{
      width:auto !important;
      /deep/ .el-input__inner{
        width: auto !important;
      }
    }
  }
}

</style>
